<template>
	<view>
		<view class="balance">
			<view class="assets-box">
				<view class="total-money">当前余额(元)</view>
			</view>
			<view class="assets-box">
				<text class="middle-number">{{userData.balance}}</text>
			</view>
			<view class="assets-box">
				<view class="balance-box">
					<view class="Cumulative-text" hover-class="active" @tap="Withdrawal">提现</view>
					<view hover-class="active" class="Cumulative-text" @tap="Recharge">充值</view>
				</view>
				<view class="balance-box1">
					<text>余额明细 ></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {createNamespacedHelpers} from 'vuex'
	const {mapState} = createNamespacedHelpers('UserInfor')
	export default {
		data() {
			return {
				
			}
		},
		computed:{
			...mapState(['userData'])
		},
		methods: {
			///充值
			Recharge(){
				uni.navigateTo({
					url:'/pages/bankCardRecharge/bankCardRecharge'
				})
			},
			
			///提现
			Withdrawal(){
				uni.navigateTo({
					url:'/pages/bankCardRecharge/Withdrawal/Withdrawal'
				})
			}
		}
	}
</script>

<style>
	.balance{
		width: 650rpx;
		height: auto;
		padding: 20rpx;
		margin: 0rpx auto;
		background: url('https://z3.ax1x.com/2021/04/22/cOFgKK.png') no-repeat;
		background-size: 100% 140%;
		margin-top: 20rpx;
		border-radius: 20rpx;
	}
	.active{
		border: 1px solid #FFFFFF;
	}
	.assets-box{
		width: 100%;
		height: auto;
		/* border: 1px solid red; */
		margin-top: 15rpx;
		display:  flex;
		flex-grow: 1;
		justify-content: space-between;
	}
	.total-money{
		font-size: 26rpx;
		font-family: Lato;
		font-weight: 400;
		color: #FFFFFF;
	}
	.middle-number{
		font-size: 38rpx;
		font-family: Lato;
		font-weight: 500;
		color: #FFFFFF;
	}
	.balance-box{
		width: 300rpx;
		height: 55rpx;
		/* border: 1px solid red; */
		display: flex;
		margin-top: 15rpx;
		justify-content: space-around;
	}
	.balance-box1{
		margin-top: 15rpx;
		font-size: 28rpx;
		font-family: Lato;
		font-weight: 400;
		color: #FFFFFF;
	}
	.Cumulative-text{
		width: 100%;
		height: 100%;
		background-color: rgba(255,255,255,0.2);
		border-radius: 30rpx;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		margin-right: 15rpx;
		text-align: center;
		line-height: 55rpx;
	}
</style>
